package com.goodving.guli.bt.profile.scale;

import android.bluetooth.BluetoothDevice;
import android.os.Handler;
import android.os.Message;

import com.goodving.guli.view.C4220a;

import java.lang.ref.WeakReference;

/**
 * Created by john on 2015/11/25.
 */
public class XMBleMessageHandler {
    private final int f8616a;
    private final int f8617b;
    private final int f8618c;
    private Handler mHandler;

    private static class MyHandler extends Handler {
        WeakReference<XMBleMessageHandler> mXMBleMessageHandler;


        MyHandler(XMBleMessageHandler bleMessageHandler) {
            mXMBleMessageHandler = new  WeakReference<>(bleMessageHandler);
        }

        public void handleMessage(Message message) {
            XMBleMessageHandler theHandler = mXMBleMessageHandler.get();
            switch (message.what) {
                case C4220a.f20875X /*5*/:
                    theHandler.m13455a(message.arg1);
                case C4220a.bt /*6*/:
                    theHandler.m13456a((BluetoothDevice) message.obj, message.arg1);
                case C4220a.bc /*7*/:
                    theHandler.m13457a((BluetoothDevice) message.obj, message.arg1, message.arg2);
                default:
            }
        }
    }

    public XMBleMessageHandler() {
        this.f8616a = 5;
        this.f8617b = 6;
        this.f8618c = 7;
        this.mHandler = new MyHandler(this);
    }

    public void m13455a(int i) {
    }

    public void m13456a(BluetoothDevice bluetoothDevice, int i) {
    }

    public void m13457a(BluetoothDevice bluetoothDevice, int i, int i2) {
    }

    public void m13458b(int i) {
        Message message = new Message();
        message.what = 5;
        message.arg1 = i;
        this.mHandler.sendMessage(message);
    }

    public void m13459b(BluetoothDevice bluetoothDevice, int i) {
        Message message = new Message();
        message.what = 6;
        message.obj = bluetoothDevice;
        message.arg1 = i;
        this.mHandler.sendMessage(message);
    }

    public void m13460b(BluetoothDevice bluetoothDevice, int i, int i2) {
        Message message = new Message();
        message.what = 7;
        message.obj = bluetoothDevice;
        message.arg1 = i;
        message.arg2 = i2;
        this.mHandler.sendMessage(message);
    }
}

